package com.catazy.module_wechat.repository

import com.catazy.module_wechat.bean.ArticleData
import com.catazy.module_wechat.bean.WXArticles
import com.catazy.module_wechat.net.HttpWeChatService
import com.catazy.wanandroid.common_base.bean.HttpResult
import dagger.hilt.android.scopes.ActivityRetainedScoped
import kotlinx.coroutines.flow.Flow
import javax.inject.Inject

/**
 *  author: wangyb
 *  date: 3/30/21 2:35 PM
 *  description: todo
 */
@ActivityRetainedScoped
class WxRemoteRepository @Inject constructor() {

    fun getWXChapters(): Flow<WXArticles> {
        return HttpWeChatService.service.getWXChapters()
    }

    fun getWXArticles(id: Int, page: Int): Flow<HttpResult<ArticleData>> {
        return HttpWeChatService.service.getWXArticles(id, page)
    }

    fun getKnowledgeList(id: Int, page: Int): Flow<HttpResult<ArticleData>> {
        return HttpWeChatService.service.getKnowledgeList(id, page)
    }
}